<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/css/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/css/themes/icon.css"/>">
<script type="text/javascript" src="<c:url value="/js/jquery.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/easyui-lang-zh_CN.js"/>"></script>
<title>蒋路的病例查询页面</title>
</head>
<body>
	<script type="text/javascript"> 
	
		$(function(){
			$('#casesearch').searchbox({
			    searcher:function(value,name){
			    	$('#casetab').datagrid('loadData',{total:0,rows:[]});
			    	if(name=="卡号"){
			    		$("#casetab").datagrid({
				    		url:'tocasepage',
				    		queryParams: {
				    			price: value
				    		}
				    	});
			    	}else if(name=="身份证号"){
			    		$.ajax({
		                    type: "Post",
		                    url: "to_findbyid",
		                    data: {idcard:value},
		                    success: function (data) {
		                    	$("#casetab").datagrid({
						    		url:'tocasepage',
						    		queryParams: {
						    			price:data
						    		}
						    	});
		                    }
		                });
			    		
			    	}			    	
			    	
			    }
			});
		});
	</script>
	
	  <table id="casetab" class="easyui-datagrid"
			data-options="
				fitColumns:true,
				fit:true,
				rownumbers: true,
			    url:'',
				border:false ,
				pagination:true,
				toolbar: '#casejl_btn',
				pageSize: 10,
				pageList:[10,20,30,40]
			">
			<thead>           
				<tr> 
					<th class="ident" data-options="field:'iName',width:10">姓名</th>
					<th class="ident" data-options="field:'iSex'">性别</th>
					<th class="ident" data-options="field:'iIdentityCard',width:15,editor:'textbox'">身份证号</th>
					<th class="ident" data-options="field:'erOpenTime',width:10,formatter:function(value){
                          var unixTimestamp = new Date(value);  
                          return unixTimestamp.toLocaleDateString();}">就诊日期
                    </th> 					
					<th class="ident" data-options="field:'erPhysician'">挂号医师</th>
					<th class="ident" data-options="field:'inpectionResult'">就诊状态</th>
					<th class="ident" data-options="field:'crCheckDate',width:10,formatter:function(value){
                          var unixTimestamp = new Date(value);  
                          return unixTimestamp.toLocaleDateString();}">检查日期
                    </th>
					<th class="ident" data-options="field:'crFigurePerson',width:15,">检查医师</th>
					<th class="ident" data-options="field:'crCheckResult',width:10,">检查结果</th>
					
				</tr>
			</thead>
		</table>
	
	<div id="casejl_btn">
		<input id="casesearch" class="easyui-searchbox" 
			data-options="menu:'#casee',width:220,prompt:'请输入。。。。'">
	</div>
	<div id="casee" style=" width:90px">
		<div date-options="name:'name'">卡号</div>
		<div date-options="name:'name'">身份证号</div>
	</div>	
</body>
</html>